#! /bin/sh

DAEMON_FILE="hippo_imp_daemon.sh"
LOCKFILE="hippo_imp.lk"



[ ! -f "$DAEMON_FILE" ] && echo "File $DAEMON_FILE not exists!exit" && exit 1
[ ! -f "$LOCKFILE" ] && echo "File $LOCKFILE not exists!exit" && exit 1
lock_pid=`cat $LOCKFILE`
if ps -ef | grep "$DAEMON_FILE" | grep "$lock_pid" | grep -qv grep ; then
  kill -9 $lock_pid
  mv hippo_imp.out log/`date +"%y%m%d%H%M"`.hippo_imp.out.log
  echo "process killed,PID=$lock_pid"
else
  echo "$DAEMON_FILE is not running!"
fi
exit 0
